Skip to content

Conversation

@cgwalters
Copy link
Collaborator

This matches bootc's setup (without the journal integration for now as we don't strictly need it).

But specifically this fixes setting RUST_LOG and having that break the monitor-status JSON stream:
#86 (comment)

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the tracing setup to prevent log messages from interfering with JSON output on standard output. The changes correctly configure logging to use standard error, remove timestamps, and apply a compact format. The implementation in crates/kit/src/main.rs is sound and effectively uses the tracing-subscriber API. I have one suggestion to improve code conciseness.

Comment on lines +157 to +161
let format = fmt::format().without_time().with_target(false).compact();

let fmt_layer = fmt::layer()
.event_format(format)
.with_writer(std::io::stderr);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the format variable is only used once, you could consider inlining its definition directly into the .event_format() call. This would make the fmt_layer configuration more concise and express it as a single fluent chain of calls, which is a common pattern when using builders in Rust.

Suggested change
let format = fmt::format().without_time().with_target(false).compact();
let fmt_layer = fmt::layer()
.event_format(format)
.with_writer(std::io::stderr);
let fmt_layer = fmt::layer()
.event_format(fmt::format().without_time().with_target(false).compact())
.with_writer(std::io::stderr);

This matches bootc's setup (without the journal integration for now
as we don't strictly need it).

But specifically this fixes setting `RUST_LOG` and having that
break the monitor-status JSON stream:
bootc-dev#86 (comment)

Signed-off-by: Colin Walters <[email protected]>
For reasons I haven't debugged yet this breaks our systemd/vsock
integration.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters mentioned this pull request Oct 28, 2025
@cgwalters cgwalters enabled auto-merge (rebase) October 28, 2025 15:33
@cgwalters cgwalters merged commit 8a3dd72 into bootc-dev:main Oct 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants